package com.zhuoyue.biz.core.api.dto.req;

import com.zhuoyue.common.group.ValidationGroups;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;

/**
 * Zigbee设备添加
 *
 * @author wjming
 */
@Data
public class ZigbeeDeviceDTO {
    /**
     * 设备ID
     */
    @NotBlank(message = "设备ID不能为空", groups = {ValidationGroups.Update.class})
    String deviceId;

    /**
     * ZigBee设备所属网关ID
     */
    @NotBlank(message = "网关ID不能为空！", groups = {ValidationGroups.Insert.class})
    private String gatewayId;

    /**
     * 所属房间ID
     */
    private String roomId;

    /**
     * ZigBee设备模块mac地址
     */
    private String zigbeeMac;

    @NotBlank(message = "设备OD索引不能为空！", groups = {ValidationGroups.Insert.class})
    private String odIndex;

    @NotBlank(message = "设备类型不能为空！", groups = {ValidationGroups.Insert.class})
    private String deviceType;

    @NotBlank(message = "产品类别不能为空！", groups = {ValidationGroups.Insert.class})
    private String productType;

    /**
     * 设备名称
     */
    @NotBlank(message = "设备类型不能为空！", groups = {ValidationGroups.Insert.class})
    @Length(min = 1, max = 15, message = "请输入1-15个字符", groups = {ValidationGroups.Insert.class, ValidationGroups.Update.class})
    private String name;

    @NotBlank(message = "设备图片不能为空！", groups = {ValidationGroups.Insert.class})
    private String imgUrl;

    /**
     * 产品Id
     * @param:
     */
    private String prodId;

    /**
     * 设备类型
     */
    private Integer type;

    /**
     *
     */
    private String spreadingType;

    /**
     * 开关的数量
     */
    private Integer switchCount;

    /**
     * 场景数量
     */
    private Integer sceneCount;

    /**
     * 推送类型
     */
    private String pushType;

    /**
     * 获取设备类型全部内容
     *
     * @return
     */
    public String getDeviceTypeAll() {
        return this.odIndex + this.deviceType + this.productType;
    }
}
